<script setup>
import { useRouter } from "vue-router";

const routes = useRouter().getRoutes().slice(0, 6);
console.log(routes);
</script>

<template>
  <div>
    <el-menu
      mode="horizontal"
      default-active="/discover/recommend"
      :router="true"
    >
      <el-menu-item
        v-for="submenus in routes"
        :index="submenus.path"
        :key="submenus.path"
      >
        <template #title>{{ submenus.meta.title }}</template>
      </el-menu-item>
    </el-menu>
    <router-view></router-view>
  </div>
</template>
